<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
    <meta http-equiv="Content-Language" content="en-us" />
    <title>Muffy Online v1.00</title>
    <%= stylesheet_link_tag "style" %>
    <%= javascript_include_tag :defaults %>


    <script type="text/javascript">
      function handleError() {
        return true;
      }
      window.onerror = handleError;
    </script>

  </head>
  <body>
    <!-- body onload="load()" -->
    <div id="header">
      <div id="logo">
        <h1>Muffy Online</h1>
      </div>

      <div id="menu">
        <% if logged_in? %>
          <ul>
            <li><%= link_to 'youths', {:controller => 'youth', :action => 'list'} %></li>
            <li><%= link_to 'institutions', {:controller => 'institution', :action => 'list'} %></li>
            <li><%= link_to 'data collections', {:controller => 'data_collection', :action => 'list'} %></li>
            <li><%= link_to 'questionnaires', {:controller => 'questionnaire', :action => 'list'} %></li>
            <% if current_user.admin? %>
              <li><%= link_to 'users', {:controller => 'users', :action => 'index'} %></li>
            <% end %>
          </ul>
        <% end %>
      </div>
    </div>



    <div id="main">
      <div id="session">
        <% if logged_in? %>
          Logged in: <%= current_user.login %>
          
	<%= link_to '[logout]', logout_url %>
	<!--- < link_to '[logout]', session_url(session.object_id), :method => :delete > -->
        <% end %>
      </div>


      <% if flash[:error] %>
        <div id="error">
          <%= flash[:error] %>
        </div>
      <% end %>

      <% if flash[:notice] %>
        <div id="notice">
          <%=flash[:notice]%>
        </div>
      <%end%>

      <% if flash[:message] %>
        <div id="error">
          Oh no! A MESSAGE!!!
        </div>
      <%end%>



      <%= yield -%>
    </div>
  </body>
</html>
